If Not greystate% And Not viewdelay% And frozen% And selectobjectmode% = 0 And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then
grabit.MousePointer = 11
setactivepage (3)
Call greyscale
Call copyblock(0, 0, sizex%, sizey%, 3, 4)
scrollaround
w1% = colourchart%(33, 1)
w2% = colourchart%(33, 2)
w3% = colourchart%(33, 3)
r1% = colourchart(34, 1) - colourchart(33, 1)
r2% = colourchart(34, 2) - colourchart(33, 2)
r3% = colourchart(34, 3) - colourchart(33, 3)
w12% = w1%
w22% = w2%
w32% = w3%
r12% = r1%
r22% = r2%
r32% = r3%
colourbaron% = True
Call copyblock(0, 0, 640, 480, 1, 0)
brushcolourdraw
scrollhere
colourinmode% = False
pixelpatch% = 0
drawbar
c1% = w1% + (r1% * .5)
c2% = w2% + (r2% * .5)
c3% = w3% + (r3% * .5)
penred% = c1%
pengreen% = c2%
penblue% = c3%
original% = 0
drawred% = penred%
drawgreen% = pengreen%
drawblue% = penblue%
selectedred% = penred%
selectedgreen% = pengreen%
selectedblue% = penblue%
greystate% = True
grabit.MousePointer = 0
End If
End Sub
Sub initializegrabit ()
'called when form is loaded
'maximize window, display it
grabit.WindowState = 2
grabit.Show
grabit.Refresh
'the GRABIT working directory
ChDir "\windows\grabit"
'standard PC-Video initialization for full-screen video
q% = pcv_loadconfiguration()
q% = pcv_initialize()
If q% = 0 Then
q% = MsgBox("The video capture adaptor was NOT found.", 48, "I have a problem !")
End
End If
q% = pcv_setcolorkey(2)
q% = pcv_createwindow(0, 0, 640, 480, 1)
q% = pcv_setwindowsize(640, 480, 0)
q% = pcv_setwindowposition(0, 0)
q% = pcv_setvideosource(0)
q% = pcv_enablevideo()
q% = pcv_freezevideo()
q% = pcv_clearvideorect(0, 0, 641, 480)
q% = pcv_unfreezevideo()
'ask user for which framegrabber is installed
'the call to INITDLL needs to be told which card is installed
card% = MsgBox("Select YES for" + Chr$(10) + Chr$(10) + "PE-Von PV100" + Chr$(10) + "Adda Aver 2000" + Chr$(10) + "Aitech Pro PC-Video" + Chr$(10) + Chr$(10) + Chr$(10) + "Select NO for" + Chr$(10) + Chr$(10) + "Creative Labs VideoBlaster", 3, "Which framegrabber do you have installed ?")
If card% <> 6 And card% <> 7 Then
q% = MsgBox("You cancelled - ending program.", 0, "The End")
End
End If
grabit.MousePointer = 11
'1st parameter inidicates number of extra pages to allocate (768K each)
'minimum of one page must be allocated
'2nd parameter indicates card type: 0 = PE-Von PV100, Adda Aver 2000, Aitech Pro PC-Video
' 1 = Creative Labs VideoBlaster
'note we are asking for 5 extra pages which is about 4MB so you better have
'8MB installed or you'll wait forever ...
Call initdll(5, card% - 6)
Call setactivepage(0)
'default object
selected$ = "obj01"
selectobjectmode% = False
Open "obj01.rgb" For Input As #1
Input #1, selectedred%
Input #1, selectedgreen%
Input #1, selectedblue%
Close
'load the colour chart values
Open "colormap" For Input As #1
For q% = 1 To 32
Input #1, colourchart%(q%, 1)
Input #1, colourchart%(q%, 2)
Input #1, colourchart%(q%, 3)
Input #1, dummy%
Next q%
Close
colourchart%(33, 1) = 50
colourchart%(33, 2) = 50
colourchart%(33, 3) = 50
colourchart%(34, 1) = 200
colourchart%(34, 2) = 200
colourchart%(34, 3) = 200
brushsize
original% = -1
target (12)
Call resetundo
'load the slide-show random fading co-ordinates
Open "fader" For Input As #123
For q% = 1 To 4800
Line Input #123, l$
area%(q%, 1) = Val(l$)
Line Input #123, l$
area%(q%, 2) = Val(l$)
Line Input #123, l$
Next q%
Close 123
'load the slide-show 'macro'
ReDim Preserve slidetext$(50, 8)
Open "slidetxt" For Input As #123
foundthestart% = False
Do Until EOF(123)
If Not foundthestart% Then Line Input #123, l$
If l$ = "BEGIN" Then foundthestart% = True
If foundthestart% Then
slidestext% = slidestext% + 1
For q% = 1 To 8
Line Input #123, l$
slidetext$(slidestext%, q%) = LTrim$(RTrim$(l$))
Next q%
If Not EOF(123) Then Line Input #123, l$
End If
Loop
Close 123
zoomstep% = 3
grabit.stepsize.Value = zoomstep%
grabit.initmess.Visible = False
grabit.MousePointer = 0
End Sub
Sub keyboardhandler (xyz%)
'the scroll-bar via the FX icon can be adjusted via the keypad as well
If Not stepperbusy% Then
stepperbusy% = True
Select Case xyz%
Case 96, 45 '0
If Not viewdelay% And frozen% And selectobjectmode% = False And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then
Call copyblock(0, 0, 640, 480, 2, 0)
Call printvideo
key0% = True
End If
Case -1, 97, 35 '1
zoomstep% = 1
Case -2, 98, 40 '2
zoomstep% = 2
Case -3, 99, 34 '3
zoomstep% = 3
Case -4, 100, 37 '4
zoomstep% = 4
Case -5, 101, 12 '5
zoomstep% = 5
Case -6, 102, 39 '6
zoomstep% = 6
Case -7, 103, 36 '7
zoomstep% = 7
Case -8, 104, 38 '8
zoomstep% = 8
Case -9, 105, 33 '9
zoomstep% = 9
End Select
If xyz% > 0 Then
grabit.stepsize.Value = zoomstep%
End If
stepperbusy% = False
End If
If grabit.registerBMP.Visible Then grabit.registerBMP.SetFocus
End Sub
Sub loadpic ()
If Not viewdelay% And frozen% And selectobjectmode% = False And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then
grabit.MousePointer = 11
Call noicons
picselect% = True
Call setactivepage(0)
q% = savemmp("temp.mmp", 0, 0, 640, 480)
Call clearpage(0)
Call blockrgb(0, 237, 628, 4, 200, 200, 200)
Call blockrgb(312, 0, 4, 480, 200, 200, 200)
q% = shrinkimage("store0.mmp", 0, 0, 49)
q% = shrinkimage("store1.mmp", 316, 0, 49)
q% = shrinkimage("store2.mmp", 0, 240, 49)
q% = shrinkimage("store3.mmp", 316, 240, 49)
grabit.MousePointer = 0
End If
End Sub
Sub loadpicshow (x, y)
logo% = -1
Call printvideo
If x < 316 Then
If y < 240 Then
q% = loadmmp("store0.mmp", 0, 0)
Else
q% = loadmmp("store2.mmp", 0, 0)
End If
Else
If y < 240 Then
q% = loadmmp("store1.mmp", 0, 0)
Else
q% = loadmmp("store3.mmp", 0, 0)
End If
End If
End Sub
Sub mirrordo ()
If Not viewdelay% And frozen% And selectobjectmode% = 0 And colourinmode% = 0 And bodystatus% = 0 And picselect% = 0 Then
grabit.MousePointer = 11
Call setactivepage(4)
Call mirror(0)
Call setactivepage(3)
Call mirror(1)
scrollaround
If grabit.registerBMP.Visible Then grabit.registerBMP.SetFocus
grabit.MousePointer = 0
End If
End Sub
Sub mousecheckker (x, y, button%, updown%)
Static chkx1%, chkx2%, chky1%, chky2%
If picselect% And updown% Then
Call loadpicshow(x, y)
ElseIf bodystatus% = 1 And Not updown% Then
If button% = 1 Then
bodymovex% = (x \ 4) * 4
bodymovey% = (y \ 4) * 4
bodystatus% = 2
grabit.MousePointer = 0
End If
ElseIf bodystatus% = 2 And Not updown% Then
If button% = 1 Then
x1% = bodymovex%
x2% = (x \ 4) * 4
y1% = bodymovey%
y2% = (y \ 4) * 4
If x1% > x2% Then
xtemp% = x1%
x1% = x2%
x2% = xtemp%
End If
If y1% > y2% Then
xtemp% = y1%
y1% = y2%
y2% = xtemp%
End If
b1% = x1%
b2% = y1%
b3% = x2%
b4% = y2%
testx% = getxpos%()
testy% = getypos%()
If x1% < testx% Then x1% = testx%
If y1% < testy% Then y1% = testy%
If x2% > testx% + sizex% Then x2% = testx% + sizex%
If y2% > testy% + sizey% Then y2% = testy% + sizey%
If (x1% >= testx%) And (x1% <= testx% + sizex%) And (x2% >= testx%) And (x2% <= testx% + sizex%) And (y1% >= testy%) And (y1% <= testy% + sizey%) And (y2% >= testy%) And (y2% <= testy% + sizey%) Then
If bodymovex% <> (x \ 4) * 4 And bodymovey% <> (y \ 4) * 4 Then
chkx1% = bodymovex%
chky1% = bodymovey%
chkx2% = x
chky2% = y
If chkx1% > chkx2% Then
xtemp% = chkx1%
chkx1% = chkx2%
chkx2% = xtemp%
End If
If chky1% > chky2% Then
xtemp% = chky1%
chky1% = chky2%
chky2% = xtemp%
End If
bodymovex% = x1%
bodymovey% = y1%
bodyx2% = x2%
bodyy2% = y2%
bodystatus% = 3
End If
End If
End If
ElseIf bodystatus% = 3 And Not updown% Then
If y > bodymovey% And y < bodyy2% And x > bodymovex% And x < bodyx2% Then
If grabit.registerBMP.Visible Then grabit.registerBMP.SetFocus
End Sub
Sub toggleiconsalloff ()
If onoff% Then toggleicon1
If onoff3% Then toggleicon3
If onoff4% Then toggleicon4
If onoff5% Then toggleicon5
End Sub
Sub undo ()
If Not viewdelay% And frozen% And selectobjectmode% = False And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then
grabit.undotimer.Enabled = True
Call undocircle
Call undocircle
Call undocircle
Call undocircle
Call undocircle
Call undocircle
End If
End Sub
Sub undoall ()
If Not viewdelay% And frozen% And selectobjectmode% = False And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then
Call toggleiconsalloff
grabit.MousePointer = 11
Call zoom(-4, 0, 0)
grabit.MousePointer = 0
End If
End Sub
Sub undoend ()
grabit.undotimer.Enabled = False
End Sub
Sub unfreeze ()
q% = pcv_unfreezevideo()
frozen% = 0
picloaded% = 0
greystate% = False
End Sub
Sub viewend ()
q% = pcv_unfreezevideo()
viewdelay% = False
grabit.freezetimer.Enabled = False
If grabit.registerBMP.Visible Then grabit.registerBMP.SetFocus
grabit.MousePointer = 0
End Sub
Sub views (side%)
If selectobjectmode% = 0 And colourinmode% = 0 And bodystatus% = 0 And picselect% = 0 Then
grabit.MousePointer = 11
Call setactivepage(0)
If Not frozen% Then 'store
grabit.freezetimer.Enabled = True
q% = pcv_freezevideo()
viewdelay% = True
If side% = 0 Then
q% = savemmp("before.mmp", 0, 0, 640, 480)
ElseIf side% = 1 Then
q% = savemmp("front.mmp", 0, 0, 640, 480)
ElseIf side% = 2 Then
q% = savemmp("profile.mmp", 0, 0, 640, 480)
End If
Else 'load
If side% = 0 Then
q% = loadmmp("before.mmp", 0, 0)
ElseIf side% = 1 Then
q% = loadmmp("front.mmp", 0, 0)
Else
q% = loadmmp("profile.mmp", 0, 0)
End If
Call copyblock(0, 0, 640, 480, 0, 2)
scrollaround
If grabit.registerBMP.Visible Then grabit.registerBMP.SetFocus
grabit.MousePointer = 0
End If
End If
End Sub
Sub zoom (updown%, special%, both%)
If Not viewdelay% And frozen% And (selectobjectmode% = False Or special%) And picloaded% And colourinmode% = False And picselect% = 0 And bodystatus% = 0 Then